home *** CD-ROM | disk | FTP | other *** search
/ TOS Silver 2000 / TOS Silver 2000.iso / Tools / RSM31D / modules / ovl_dev / ovlstart.c < prev   
Encoding:
C/C++ Source or Header  |  1998-12-27  |  546 b   |  34 lines

  1. #include <portab.h>
  2. #include <osbind.h>
  3. #include <string.h>
  4. #include <basepage.h>
  5. #include <gemfast.h>
  6. #include "ovl.h"
  7.  
  8.  
  9. extern OVL_RSM Overlay;
  10.  
  11. char Cmp[] = "RSMOVL";
  12. WORD start(BASEPAGE* BasePage)
  13. {
  14.     WORD Ret = 1;
  15.  
  16.     if(BasePage->p_cmdlin[0] == 14)
  17.     {
  18.         if(!strncmp(&BasePage->p_cmdlin[1], Cmp, 6))
  19.         {
  20.             LONG Adr        = 0;
  21.             char* Pos    = &BasePage->p_cmdlin[7];
  22.             WORD i;
  23.  
  24.             for(i=0; i<8; i++)
  25.             {
  26.                 Adr <<= 4;
  27.                 Adr |= *Pos++ - 'A';
  28.             }
  29.             *((OVL_RSM**)Adr)    = &Overlay;
  30.             Ret = 0;
  31.         }
  32.     }
  33.     Pterm(Ret);
  34. }